<template>
  <div class="toast" v-show="isShow">
    {{message}}
  </div>
</template>

<script>
  export default {
    name: "Toast",
    data(){
      return {
        message: "",
        isShow:false
      }
    },
    methods:{
      show(message,time){
        this.message = message;
        this.isShow = true;
        setTimeout(()=>{
          this.isShow = false;
        },time)
      }
    }
  }
</script>

<style scoped>
  .toast{
    position: fixed;
    padding: 8px 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    color: white;
    font-size: 17px;
    font-weight: 600;
    z-index: 999;
    background-color: rgba(98, 102, 107,0.6);
  }
</style>